1;; init.el --- Emacs configuration

;; INSTALL PACKAGES
;; --------------------------------------
;;(add-to-list 'load-path "~/.emacs.d/weechat-load-path/")
(add-to-list 'load-path "~/.emacs.d/mdpreview-load-path/")
(add-to-list 'load-path "~/.emacs.d/s-load-path/")
(add-to-list 'load-path "~/.emacs.d/my_el/")
;;(add-to-list 'load-path "~/.emacs.d/matlab-emacs/")
;;(require 'weechat)
(require 'package)
(require 'cl)
(require 'cl-lib)
;;(require 'matlab-load)
(setq package-archives  
      '(("gnu" . "http://elpa.emacs-china.org/gnu/")  
        ("melpa" . "http://melpa.milkbox.net/packages/")
	("melpa-stable" . "https://stable.melpa.org/packages/")))
(package-initialize) 

(when (not package-archive-contents)
  (package-refresh-contents))
(defvar myPackages
  '(better-defaults
    ecb
    ggtags
    csv
    csv-mode
    markdown-preview-mode
    markdown-mode+
    markdown-preview-eww
    markdown-mode
    elpy
    ein
    flycheck
    ;;weechat
    ;;py-autopep8
    xref-js2
    google-translate
    ;;weechat-alert
    virtualenv
    spacemacs-theme
    solarized-theme
    s-buffer
    jedi
    eww-lnum
    elpygen
    elpa-clone
    eink-theme
    anaconda-mode
    eimp
    company-jedi
    flycheck-clang-tidy
    jedi-direx
    auto-complete
    ))

(mapc #'(lambda (package)
    (unless (package-installed-p package)
      (package-install package)))
      myPackages)

;; BASIC CUSTOMIZATION
;; --------------------------------------

(setq inhibit-startup-message t) ;; hide the startup message
;;(load-theme 'material t) ;; load material theme


;;my things
(tool-bar-mode -1)
(global-linum-mode t) ;; enable line numbers globally
(setq cursor-type 'bar)
(setq inhibit-splash-screen 1)
(defun open-init-file()
  (interactive)
  (find-file "~/.emacs.d/init.el"))
(global-set-key (kbd "<f2>") 'open-init-file)
(global-company-mode 1)
(setq make-backup-files nil)
(require 'recentf)
(recentf-mode 1)
(setq recentf-max-menu-item 10)
(delete-selection-mode 1)
(add-hook 'emacs-lisp-mode-hook 'show-paren-mode)

;; init.el ends here
(add-to-list 'load-path "~/.emacs.d/ein-load-path")
(require 'ein)


;; google translate
(require 'google-translate)

;;If google-translate-enable-ido-completion is non-NIL, the input will be read with ido-style completion.
(setq-default google-translate-enable-ido-completion t)

(setq-default google-translate-default-source-language "en")
(setq-default google-translate-default-target-language "zh-CN")

;;eim
(add-to-list 'load-path "~/.emacs.d/site-lisp/eim")
(autoload 'eim-use-package "eim" "Another emacs input method")
;(setq eim-use-tooltip nil)
(register-input-method
 "eim-wb" "euc-cn" 'eim-use-package
 "五笔" "汉字五笔输入法" "~/.emacs.d/site-lisp/eim/wb.txt")
(register-input-method
   "eim-py" "euc-cn" 'eim-use-package
   "拼音" "汉字拼音输入法" "~/.emacs.d/site-lisp/eim/py.txt")
(require 'eim-extra)
(global-set-key (kbd "C-;") 'eim-insert-ascii)

;;some settings about matlab
;;(autoload 'matlab-mode "matlab" "Enter Matlab mode" t)
;;(setq auto-mode-alist (cons '("\\.m\\'" . matlab-mode) auto-mode-alist))
;;(autoload 'matlab-shell "matlab" "Interactive MATLAB mode" t)

;;elpy
(require 'elpy)
(elpy-enable)
(setq elpy-rpc-backend "jedi")



;; something on https://blog.csdn.net/shqhope/article/details/54141918
(add-to-list 'load-path "~/.emacs.d/my-set")
(load "base.el")
;;(load "my-c-code.el")

(load-theme 'tsdh-dark)
